package com.yanyeori.springaop.dao.impl;

import com.yanyeori.springaop.dao.UserDao;
import com.yanyeori.springaop.entity.User;
import org.springframework.stereotype.Repository;

/**
 * @author chenkuan
 * @desc
 * @date 2021/3/10 010 19:03
 */
@Repository
public class UserDaoImpl implements UserDao {
    @Override
    public User select(Integer id) {
        if (id == null) {
            throw new NullPointerException("id不能为null");
        }
        return new User();
    }

    @Override
    public void add(User user) {
        if (user == null) {
            throw new NullPointerException("user不能为null");
        }
    }

    @Override
    public void update(User user) {
        if (user == null) {
            throw new NullPointerException("user不能为null");
        }
    }

    @Override
    public void delete(Integer id) {
        if (id == null) {
            throw new NullPointerException("id不能为null");
        }
    }
}
